package com.manager.core.web.json;

/**
 * 封装相应JSON实体类
 *
 * @author H
 */
public class AjaxJson {

    private int code = 0;// 提示信息
    private String msg = "操作失败！";
    private Object data = null;// 其他参数

    public AjaxJson() {
    }

    public AjaxJson(int code) {
        this.code = code;
        if (code > 0) {
            this.msg = "操作成功！";
        }
    }

    public AjaxJson(String msg) {
        this.msg = msg;
    }

    public AjaxJson(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public AjaxJson(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}